/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package kimo.persistence.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author a381u296
 */
@Entity
@Table(name = "producer")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Producer.findAll", query = "SELECT p FROM Producer p"),
    @NamedQuery(name = "Producer.findByProducerId", query = "SELECT p FROM Producer p WHERE p.producerId = :producerId"),
    @NamedQuery(name = "Producer.findByProducerAfm", query = "SELECT p FROM Producer p WHERE p.producerAfm = :producerAfm"),
    @NamedQuery(name = "Producer.findByProducerSurname", query = "SELECT p FROM Producer p WHERE p.producerSurname = :producerSurname"),
    @NamedQuery(name = "Producer.findByProducerFirstName", query = "SELECT p FROM Producer p WHERE p.producerFirstName = :producerFirstName"),
    @NamedQuery(name = "Producer.findByProducerFatherName", query = "SELECT p FROM Producer p WHERE p.producerFatherName = :producerFatherName"),
    @NamedQuery(name = "Producer.findByProducerBirthdate", query = "SELECT p FROM Producer p WHERE p.producerBirthdate = :producerBirthdate"),
    @NamedQuery(name = "Producer.findByProducerAdt", query = "SELECT p FROM Producer p WHERE p.producerAdt = :producerAdt"),
    @NamedQuery(name = "Producer.findByProducerAdtIssueDate", query = "SELECT p FROM Producer p WHERE p.producerAdtIssueDate = :producerAdtIssueDate"),
    @NamedQuery(name = "Producer.findByProducerAdtIssueDepartment", query = "SELECT p FROM Producer p WHERE p.producerAdtIssueDepartment = :producerAdtIssueDepartment"),
    @NamedQuery(name = "Producer.findByProducerAddressStreet", query = "SELECT p FROM Producer p WHERE p.producerAddressStreet = :producerAddressStreet"),
    @NamedQuery(name = "Producer.findByProducerAddressNumber", query = "SELECT p FROM Producer p WHERE p.producerAddressNumber = :producerAddressNumber"),
    @NamedQuery(name = "Producer.findByProducerAddressZip", query = "SELECT p FROM Producer p WHERE p.producerAddressZip = :producerAddressZip"),
    @NamedQuery(name = "Producer.findByProducerPhone", query = "SELECT p FROM Producer p WHERE p.producerPhone = :producerPhone"),
    @NamedQuery(name = "Producer.findByProducerFax", query = "SELECT p FROM Producer p WHERE p.producerFax = :producerFax"),
    @NamedQuery(name = "Producer.findByProducerMobilePhone", query = "SELECT p FROM Producer p WHERE p.producerMobilePhone = :producerMobilePhone"),
    @NamedQuery(name = "Producer.findByProducerEmail", query = "SELECT p FROM Producer p WHERE p.producerEmail = :producerEmail"),
    @NamedQuery(name = "Producer.findByProducerRuralAddressStreet", query = "SELECT p FROM Producer p WHERE p.producerRuralAddressStreet = :producerRuralAddressStreet"),
    @NamedQuery(name = "Producer.findByProducerRuralAddressNumber", query = "SELECT p FROM Producer p WHERE p.producerRuralAddressNumber = :producerRuralAddressNumber"),
    @NamedQuery(name = "Producer.findByProducerRuralAddressZip", query = "SELECT p FROM Producer p WHERE p.producerRuralAddressZip = :producerRuralAddressZip"),
    @NamedQuery(name = "Producer.findByProducerSubmittedAppliation", query = "SELECT p FROM Producer p WHERE p.producerSubmittedAppliation = :producerSubmittedAppliation"),
    @NamedQuery(name = "Producer.findByProducerSubmittedApplicationDate", query = "SELECT p FROM Producer p WHERE p.producerSubmittedApplicationDate = :producerSubmittedApplicationDate"),
    @NamedQuery(name = "Producer.findByProducerConfirm1", query = "SELECT p FROM Producer p WHERE p.producerConfirm1 = :producerConfirm1"),
    @NamedQuery(name = "Producer.findByProducerComment1", query = "SELECT p FROM Producer p WHERE p.producerComment1 = :producerComment1"),
    @NamedQuery(name = "Producer.findByProducerConfirm2", query = "SELECT p FROM Producer p WHERE p.producerConfirm2 = :producerConfirm2"),
    @NamedQuery(name = "Producer.findByProducerComment2", query = "SELECT p FROM Producer p WHERE p.producerComment2 = :producerComment2"),
    @NamedQuery(name = "Producer.findByProducerConfirm3", query = "SELECT p FROM Producer p WHERE p.producerConfirm3 = :producerConfirm3"),
    @NamedQuery(name = "Producer.findByProducerComment3", query = "SELECT p FROM Producer p WHERE p.producerComment3 = :producerComment3"),
    @NamedQuery(name = "Producer.findByProducerConfirm4", query = "SELECT p FROM Producer p WHERE p.producerConfirm4 = :producerConfirm4"),
    @NamedQuery(name = "Producer.findByProducerComment4", query = "SELECT p FROM Producer p WHERE p.producerComment4 = :producerComment4"),
    @NamedQuery(name = "Producer.findByProducerConfirm5", query = "SELECT p FROM Producer p WHERE p.producerConfirm5 = :producerConfirm5"),
    @NamedQuery(name = "Producer.findByProducerComment5", query = "SELECT p FROM Producer p WHERE p.producerComment5 = :producerComment5"),
    @NamedQuery(name = "Producer.findByProducerConfirmed", query = "SELECT p FROM Producer p WHERE p.producerConfirmed = :producerConfirmed"),
    @NamedQuery(name = "Producer.findByProducerConfirmDate", query = "SELECT p FROM Producer p WHERE p.producerConfirmDate = :producerConfirmDate"),
    @NamedQuery(name = "Producer.findByProducerRegisterCd", query = "SELECT p FROM Producer p WHERE p.producerRegisterCd = :producerRegisterCd")})
public class Producer implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "producer_id")
    private Integer producerId;
    @Basic(optional = false)
    @Column(name = "producer_afm")
    private String producerAfm;
    @Basic(optional = false)
    @Column(name = "producer_surname")
    private String producerSurname;
    @Basic(optional = false)
    @Column(name = "producer_first_name")
    private String producerFirstName;
    @Basic(optional = false)
    @Column(name = "producer_father_name")
    private String producerFatherName;
    @Basic(optional = false)
    @Column(name = "producer_birthdate")
    @Temporal(TemporalType.DATE)
    private Date producerBirthdate;
    @Basic(optional = false)
    @Column(name = "producer_adt")
    private String producerAdt;
    @Basic(optional = false)
    @Column(name = "producer_adt_issue_date")
    @Temporal(TemporalType.DATE)
    private Date producerAdtIssueDate;
    @Basic(optional = false)
    @Column(name = "producer_adt_issue_department")
    private String producerAdtIssueDepartment;
    @Basic(optional = false)
    @Column(name = "producer_address_street")
    private String producerAddressStreet;
    @Basic(optional = false)
    @Column(name = "producer_address_number")
    private String producerAddressNumber;
    @Basic(optional = false)
    @Column(name = "producer_address_zip")
    private String producerAddressZip;
    @Basic(optional = false)
    @Column(name = "producer_phone")
    private String producerPhone;
    @Column(name = "producer_fax")
    private String producerFax;
    @Column(name = "producer_mobile_phone")
    private String producerMobilePhone;
    @Basic(optional = false)
    @Column(name = "producer_email")
    private String producerEmail;
    @Basic(optional = false)
    @Column(name = "producer_rural_address_street")
    private String producerRuralAddressStreet;
    @Basic(optional = false)
    @Column(name = "producer_rural_address_number")
    private String producerRuralAddressNumber;
    @Basic(optional = false)
    @Column(name = "producer_rural_address_zip")
    private String producerRuralAddressZip;
    @Basic(optional = false)
    @Column(name = "producer_submitted_appliation")
    private boolean producerSubmittedAppliation;
    @Column(name = "producer_submitted_application_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date producerSubmittedApplicationDate;
    @Column(name = "producer_confirm_1")
    private Boolean producerConfirm1;
    @Column(name = "producer_comment_1")
    private String producerComment1;
    @Column(name = "producer_confirm_2")
    private Boolean producerConfirm2;
    @Column(name = "producer_comment_2")
    private String producerComment2;
    @Column(name = "producer_confirm_3")
    private Boolean producerConfirm3;
    @Column(name = "producer_comment_3")
    private String producerComment3;
    @Column(name = "producer_confirm_4")
    private Boolean producerConfirm4;
    @Column(name = "producer_comment_4")
    private String producerComment4;
    @Column(name = "producer_confirm_5")
    private Boolean producerConfirm5;
    @Column(name = "producer_comment_5")
    private String producerComment5;
    @Basic(optional = false)
    @Column(name = "producer_confirmed")
    private boolean producerConfirmed;
    @Column(name = "producer_confirm_date")
    @Temporal(TemporalType.DATE)
    private Date producerConfirmDate;
    @Column(name = "producer_register_cd")
    private String producerRegisterCd;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "checkProducerId")
    private List<Pcheck> pcheckList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "productionProducerId")
    private List<Production> productionList;
    @JoinColumn(name = "producer_unit_location_type_id", referencedColumnName = "unit_location_type_id")
    @ManyToOne(optional = false)
    private UnitLocationType producerUnitLocationTypeId;
    @JoinColumn(name = "producer_rural_municipality_id", referencedColumnName = "municipality_id")
    @ManyToOne(optional = false)
    private Municipality producerRuralMunicipalityId;
    @JoinColumn(name = "producer_municipality_id", referencedColumnName = "municipality_id")
    @ManyToOne(optional = false)
    private Municipality producerMunicipalityId;
    @JoinColumn(name = "producer_adt_type_id", referencedColumnName = "adt_type_id")
    @ManyToOne(optional = false)
    private AdtType producerAdtTypeId;
    @JoinColumn(name = "producer_sex_id", referencedColumnName = "sex_id")
    @ManyToOne(optional = false)
    private Sex producerSexId;
    @JoinColumn(name = "producer_daok_cd", referencedColumnName = "daok_cd")
    @ManyToOne(optional = false)
    private Daok producerDaokCd;

    public Producer() {
    }

    public Producer(Integer producerId) {
        this.producerId = producerId;
    }

    public Producer(Integer producerId, String producerAfm, String producerSurname, String producerFirstName, String producerFatherName, Date producerBirthdate, String producerAdt, Date producerAdtIssueDate, String producerAdtIssueDepartment, String producerAddressStreet, String producerAddressNumber, String producerAddressZip, String producerPhone, String producerEmail, String producerRuralAddressStreet, String producerRuralAddressNumber, String producerRuralAddressZip, boolean producerSubmittedAppliation, boolean producerConfirmed) {
        this.producerId = producerId;
        this.producerAfm = producerAfm;
        this.producerSurname = producerSurname;
        this.producerFirstName = producerFirstName;
        this.producerFatherName = producerFatherName;
        this.producerBirthdate = producerBirthdate;
        this.producerAdt = producerAdt;
        this.producerAdtIssueDate = producerAdtIssueDate;
        this.producerAdtIssueDepartment = producerAdtIssueDepartment;
        this.producerAddressStreet = producerAddressStreet;
        this.producerAddressNumber = producerAddressNumber;
        this.producerAddressZip = producerAddressZip;
        this.producerPhone = producerPhone;
        this.producerEmail = producerEmail;
        this.producerRuralAddressStreet = producerRuralAddressStreet;
        this.producerRuralAddressNumber = producerRuralAddressNumber;
        this.producerRuralAddressZip = producerRuralAddressZip;
        this.producerSubmittedAppliation = producerSubmittedAppliation;
        this.producerConfirmed = producerConfirmed;
    }

    public Integer getProducerId() {
        return producerId;
    }

    public void setProducerId(Integer producerId) {
        this.producerId = producerId;
    }

    public String getProducerAfm() {
        return producerAfm;
    }

    public void setProducerAfm(String producerAfm) {
        this.producerAfm = producerAfm;
    }

    public String getProducerSurname() {
        return producerSurname;
    }

    public void setProducerSurname(String producerSurname) {
        this.producerSurname = producerSurname;
    }

    public String getProducerFirstName() {
        return producerFirstName;
    }

    public void setProducerFirstName(String producerFirstName) {
        this.producerFirstName = producerFirstName;
    }

    public String getProducerFatherName() {
        return producerFatherName;
    }

    public void setProducerFatherName(String producerFatherName) {
        this.producerFatherName = producerFatherName;
    }

    public Date getProducerBirthdate() {
        return producerBirthdate;
    }

    public void setProducerBirthdate(Date producerBirthdate) {
        this.producerBirthdate = producerBirthdate;
    }

    public String getProducerAdt() {
        return producerAdt;
    }

    public void setProducerAdt(String producerAdt) {
        this.producerAdt = producerAdt;
    }

    public Date getProducerAdtIssueDate() {
        return producerAdtIssueDate;
    }

    public void setProducerAdtIssueDate(Date producerAdtIssueDate) {
        this.producerAdtIssueDate = producerAdtIssueDate;
    }

    public String getProducerAdtIssueDepartment() {
        return producerAdtIssueDepartment;
    }

    public void setProducerAdtIssueDepartment(String producerAdtIssueDepartment) {
        this.producerAdtIssueDepartment = producerAdtIssueDepartment;
    }

    public String getProducerAddressStreet() {
        return producerAddressStreet;
    }

    public void setProducerAddressStreet(String producerAddressStreet) {
        this.producerAddressStreet = producerAddressStreet;
    }

    public String getProducerAddressNumber() {
        return producerAddressNumber;
    }

    public void setProducerAddressNumber(String producerAddressNumber) {
        this.producerAddressNumber = producerAddressNumber;
    }

    public String getProducerAddressZip() {
        return producerAddressZip;
    }

    public void setProducerAddressZip(String producerAddressZip) {
        this.producerAddressZip = producerAddressZip;
    }

    public String getProducerPhone() {
        return producerPhone;
    }

    public void setProducerPhone(String producerPhone) {
        this.producerPhone = producerPhone;
    }

    public String getProducerFax() {
        return producerFax;
    }

    public void setProducerFax(String producerFax) {
        this.producerFax = producerFax;
    }

    public String getProducerMobilePhone() {
        return producerMobilePhone;
    }

    public void setProducerMobilePhone(String producerMobilePhone) {
        this.producerMobilePhone = producerMobilePhone;
    }

    public String getProducerEmail() {
        return producerEmail;
    }

    public void setProducerEmail(String producerEmail) {
        this.producerEmail = producerEmail;
    }

    public String getProducerRuralAddressStreet() {
        return producerRuralAddressStreet;
    }

    public void setProducerRuralAddressStreet(String producerRuralAddressStreet) {
        this.producerRuralAddressStreet = producerRuralAddressStreet;
    }

    public String getProducerRuralAddressNumber() {
        return producerRuralAddressNumber;
    }

    public void setProducerRuralAddressNumber(String producerRuralAddressNumber) {
        this.producerRuralAddressNumber = producerRuralAddressNumber;
    }

    public String getProducerRuralAddressZip() {
        return producerRuralAddressZip;
    }

    public void setProducerRuralAddressZip(String producerRuralAddressZip) {
        this.producerRuralAddressZip = producerRuralAddressZip;
    }

    public boolean getProducerSubmittedAppliation() {
        return producerSubmittedAppliation;
    }

    public void setProducerSubmittedAppliation(boolean producerSubmittedAppliation) {
        this.producerSubmittedAppliation = producerSubmittedAppliation;
    }

    public Date getProducerSubmittedApplicationDate() {
        return producerSubmittedApplicationDate;
    }

    public void setProducerSubmittedApplicationDate(Date producerSubmittedApplicationDate) {
        this.producerSubmittedApplicationDate = producerSubmittedApplicationDate;
    }

    public Boolean getProducerConfirm1() {
        return producerConfirm1;
    }

    public void setProducerConfirm1(Boolean producerConfirm1) {
        this.producerConfirm1 = producerConfirm1;
    }

    public String getProducerComment1() {
        return producerComment1;
    }

    public void setProducerComment1(String producerComment1) {
        this.producerComment1 = producerComment1;
    }

    public Boolean getProducerConfirm2() {
        return producerConfirm2;
    }

    public void setProducerConfirm2(Boolean producerConfirm2) {
        this.producerConfirm2 = producerConfirm2;
    }

    public String getProducerComment2() {
        return producerComment2;
    }

    public void setProducerComment2(String producerComment2) {
        this.producerComment2 = producerComment2;
    }

    public Boolean getProducerConfirm3() {
        return producerConfirm3;
    }

    public void setProducerConfirm3(Boolean producerConfirm3) {
        this.producerConfirm3 = producerConfirm3;
    }

    public String getProducerComment3() {
        return producerComment3;
    }

    public void setProducerComment3(String producerComment3) {
        this.producerComment3 = producerComment3;
    }

    public Boolean getProducerConfirm4() {
        return producerConfirm4;
    }

    public void setProducerConfirm4(Boolean producerConfirm4) {
        this.producerConfirm4 = producerConfirm4;
    }

    public String getProducerComment4() {
        return producerComment4;
    }

    public void setProducerComment4(String producerComment4) {
        this.producerComment4 = producerComment4;
    }

    public Boolean getProducerConfirm5() {
        return producerConfirm5;
    }

    public void setProducerConfirm5(Boolean producerConfirm5) {
        this.producerConfirm5 = producerConfirm5;
    }

    public String getProducerComment5() {
        return producerComment5;
    }

    public void setProducerComment5(String producerComment5) {
        this.producerComment5 = producerComment5;
    }

    public boolean getProducerConfirmed() {
        return producerConfirmed;
    }

    public void setProducerConfirmed(boolean producerConfirmed) {
        this.producerConfirmed = producerConfirmed;
    }

    public Date getProducerConfirmDate() {
        return producerConfirmDate;
    }

    public void setProducerConfirmDate(Date producerConfirmDate) {
        this.producerConfirmDate = producerConfirmDate;
    }

    public String getProducerRegisterCd() {
        return producerRegisterCd;
    }

    public void setProducerRegisterCd(String producerRegisterCd) {
        this.producerRegisterCd = producerRegisterCd;
    }

    @XmlTransient
    public List<Pcheck> getPcheckList() {
        return pcheckList;
    }

    public void setPcheckList(List<Pcheck> pcheckList) {
        this.pcheckList = pcheckList;
    }

    @XmlTransient
    public List<Production> getProductionList() {
        return productionList;
    }

    public void setProductionList(List<Production> productionList) {
        this.productionList = productionList;
    }

    public UnitLocationType getProducerUnitLocationTypeId() {
        return producerUnitLocationTypeId;
    }

    public void setProducerUnitLocationTypeId(UnitLocationType producerUnitLocationTypeId) {
        this.producerUnitLocationTypeId = producerUnitLocationTypeId;
    }

    public Municipality getProducerRuralMunicipalityId() {
        return producerRuralMunicipalityId;
    }

    public void setProducerRuralMunicipalityId(Municipality producerRuralMunicipalityId) {
        this.producerRuralMunicipalityId = producerRuralMunicipalityId;
    }

    public Municipality getProducerMunicipalityId() {
        return producerMunicipalityId;
    }

    public void setProducerMunicipalityId(Municipality producerMunicipalityId) {
        this.producerMunicipalityId = producerMunicipalityId;
    }

    public AdtType getProducerAdtTypeId() {
        return producerAdtTypeId;
    }

    public void setProducerAdtTypeId(AdtType producerAdtTypeId) {
        this.producerAdtTypeId = producerAdtTypeId;
    }

    public Sex getProducerSexId() {
        return producerSexId;
    }

    public void setProducerSexId(Sex producerSexId) {
        this.producerSexId = producerSexId;
    }

    public Daok getProducerDaokCd() {
        return producerDaokCd;
    }

    public void setProducerDaokCd(Daok producerDaokCd) {
        this.producerDaokCd = producerDaokCd;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (producerId != null ? producerId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Producer)) {
            return false;
        }
        Producer other = (Producer) object;
        if ((this.producerId == null && other.producerId != null) || (this.producerId != null && !this.producerId.equals(other.producerId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return producerSurname + " " + producerFirstName;
    }
    
}
